package my.test;

import java.util.Random;

import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.Path;
import org.zkoss.zul.api.Window;

public class Person implements Comparable<Person>{
	private String firstName = "FirstName";
	private String lastName = "LastName";
	
	private String id = new Random().toString();

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public int compareTo(Person o) {		
		return o.firstName.compareTo(this.firstName);
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	public void open() throws Exception {
		Component parent = Path.getComponent("/mywin");
		Component win = Executions.createComponents("/zk_dialog.cul", parent, null);
		((Window) win).doModal();
	}

}